# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
#
# This PKGBUILD was extracted from AUR.
# Creator: John D Jones III AKA jnbek <jnbek1972 -_AT_- g m a i l -_Dot_- com>
# Changes by: petruknisme

pkgname=perl-test-refcount
_pkgname=Test-Refcount
pkgver=0.10
pkgrel=5
pkgdesc='Assert reference counts on objects.'
arch=('any')
url='https://metacpan.org/release/Test-Refcount'
license=('GPL' 'PerlArtistic')
depends=('perl' 'perl-module-build')
options=('!emptydirs')
source=("http://search.cpan.org/CPAN/authors/id/P/PE/PEVANS/$_pkgname-$pkgver.tar.gz")
sha512sums=('7fac2a6bcb96da0ed61c53aaa2278e1ac998bd62314b95f307fe6ee032fd7d89264968f3ad78066186b112af0ba45960d5d1c81822bcd5f218418ea81236c4e1')


build() {
  cd "$_pkgname-$pkgver"

  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB="" PERL_AUTOINSTALL=--skipdeps \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null

   /usr/bin/perl Build.PL

   ./Build
  )
}

package() {
  cd "$_pkgname-$pkgver"

  ./Build install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

